package com.yami.shop.bean.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 商家钱包信息
 *
 * @author Dwl
 * @date 2019-09-19 14:02:57
 */
@Data
@TableName("tz_shop_wallet")
public class ShopWallet implements Serializable{
    private static final long serialVersionUID = 1L;

    @TableId
    @Schema(description = "店铺钱包id")
    private Long shopWalletId;

    @Schema(description = "店铺id")
    private Long shopId;

    @Schema(description = "未结算金额（用户支付）")
    private Double unsettledAmount;

    @Schema(description = "已结算金额（用户确认收货后，可以提现）")
    private Double settledAmount;

    @Schema(description = "冻结金额（用户提现申请）")
    private Double freezeAmount;

    @Schema(description = "累积结算金额")
    private Double totalSettledAmount;
    /**
     * 乐观锁
     */
    @Version
    private Long version;

    @Schema(description = "更新时间")
    private Date updateTime;

    @Schema(description = "店铺名称")
    @TableField(exist = false)
    private String shopName;

    @Schema(description = "店铺logo")
    @TableField(exist = false)
    @JsonSerialize(using = ImgJsonSerializer.class)
    private String shopLogo;
}
